package com.dream.xcarrecorder;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.widget.ListView;

import androidx.annotation.Nullable;

import com.dream.xcarrecorder.data.RecAdapter;

public class RecListActivity extends Activity {

    private RecAdapter mAdapter = null;
    private Context mContext = null;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_rec);
        mContext = this;
        ListView listView = findViewById(R.id.list_rec_listview);
        mAdapter = new RecAdapter(mContext);
        mAdapter.loadData(mContext.getExternalFilesDir(Environment.DIRECTORY_PICTURES).getAbsolutePath());

        listView.setAdapter(mAdapter);
    }

    public static void startActivity(Context ct){
        Intent i = new Intent(ct, RecListActivity.class);
        ct.startActivity(i);
    }
}
